/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package BD;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author Andre
 */
public class CriaConexao {
 public static Connection getConexao() throws SQLException{
   
     
     
     try{
         String url ="jdbc:postgresql://localhost:5432/sgh";
         Class.forName("org.postgresql.Driver");

         return (Connection) DriverManager.getConnection(url,"postgres","123");
     }catch(ClassNotFoundException e) {
         throw new SQLException(e.getMessage());
     }
 }
}
